Texture2D tex1 : register(t0);
sampler texSampler : register(s0);

struct VSQuadOut{
	float4 position : SV_Position;
	float2 texcoord: TexCoord;
};

float4 ps_main(VSQuadOut Input) : SV_TARGET
{
	float4 color = tex1.Sample(texSampler, Input.texcoord);
	// color.xyz = color.xyz * (1.95 - Input.Texcoord.y);          // + color.y + color.z)/ 3.0;"+
	//color = float4(1.0, 0.8, 0.8, 0.3);
	return color;
	// return float4( pow(color.xyz, 1.0 / 1.0), color.w );        //return float4(pow(color.xyz, 1.0 / 2.2), color.w);
}

float4 ps_main2(VSQuadOut Input) : SV_TARGET
{
	float4 Color = float4(0, 0, 0, 1);

	Color = tex1.Sample(texSampler, Input.texcoord);
	float test = tex1.Sample(texSampler, Input.texcoord + (Input.texcoord * 0.2)).r * 0.3;
	Color.r -= test;
	Color.g += tex1.Sample(texSampler, Input.texcoord + (Input.texcoord * 0.2)).g* 0.1;
	Color.b -= tex1.Sample(texSampler, Input.texcoord + (Input.texcoord * 0.2)).b* 0.4;

	//Color -= tex1.Sample(texSampler , Input.texcoord.xy-0.003)*2.7f; 
	//Color += tex1.Sample( texSampler , Input.texcoord.xy+0.003)*2.7f; 
	//Color.rgb = (Color.r+Color.g+Color.b)/3.0f;
	return Color;
}

float rand_1_05(in float2 uv)
{
	float2 noise = (frac(sin(dot(uv, float2(12.9898, 78.233)*2.0)) * 43758.5453));
		return abs(noise.x + noise.y) * 0.5;
}

float2 rand_2_10(in float2 uv) {
	float noiseX = (frac(sin(dot(uv, float2(12.9898, 78.233) * 2.0)) * 43758.5453));
	float noiseY = sqrt(1 - noiseX * noiseX);
	return float2(noiseX, noiseY);
}

float2 rand_2_0004(in float2 uv)
{
	float noiseX = (frac(sin(dot(uv, float2(12.9898, 78.233))) * 43758.5453));
	float noiseY = (frac(sin(dot(uv, float2(12.9898, 78.233) * 2.0)) * 43758.5453));
	return float2(noiseX, noiseY) * 0.004;
}
